package wang.Seacher;

import java.util.concurrent.CountDownLatch;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

/**
 */
@SpringBootApplication
public class Application {
	
	private static final Logger logger = LoggerFactory.getLogger(Application.class);

	@Bean
	public CountDownLatch closeLatch() {
		return new CountDownLatch(1);
	}

	public static void main(String[] args) throws InterruptedException {

		ApplicationContext ctx = new SpringApplicationBuilder().sources(Application.class).web(true).run(args);
		CountDownLatch closeLatch = ctx.getBean(CountDownLatch.class);

		System.err.println("ciyun-report-parser Server Startup success");
		logger.info("=======================ciyun-report-parser Server Startup success!=========================");

		closeLatch.await();

	}

}
